const express=require('express')
const app=express()
const mysql=require('mysql')
const db=mysql.createPool({
    host:'localhost',
    port:'3306',
    user:'root',
    password:'123456',
    database:'shopdb'
})
app.use(express.static('./public'))
app.get('/test',(req,res)=>{
    let sql='selsct * from t_goods'
    db.query(sql,[],(err,result)=>{
        res.send(result)
    })
})
app.listen(3000,()=>{
    console.log("server is runing at port 3000...");
})